package com.mstore.service;

import java.util.List;

import com.mstore.dao.ThirdActDao;
import com.mstore.pojo.ThirdAct;
/**
 *  第三方凭证
 *
 */
public class ThirdActService {

	private ThirdActDao thirdactDao;
	/**
	 * 
	 * 添加凭证
	 */
	public void addThirdAccount(ThirdAct thirdact) {
		thirdactDao.save(thirdact);
	}
	/**
	 * 
	 *查询所有
	 */
	public List<Object> getAll(ThirdAct thirdact) {
		return thirdactDao.getAll(thirdact);
	}
	/**
	 * 
	 * 获取单条记录
	 */
	public ThirdAct getThirdActByEaId(ThirdAct thirdact){
		List<Object> act = thirdactDao.getAll(thirdact);
		if (act.size() == 0) {
			return null;
		}
		return (ThirdAct)act.get(0);
	}
	
	public List<Object> getThirdActByYsId(ThirdAct thirdact){
		List<Object> objects = thirdactDao.getThirdActByYsId(thirdact);
		return objects;
	}
	/**
	 * 
	 * 更新记录
	 */
	public void updateThirdAccount(ThirdAct thirdact) {
		thirdactDao.update(thirdact);
	}

	public ThirdActDao getThirdactDao() {
		return thirdactDao;
	}

	public void setThirdactDao(ThirdActDao thirdactDao) {
		this.thirdactDao = thirdactDao;
	}
}
